package cn.tedu.restaurant.service;

import cn.tedu.restaurant.entity.User;
import cn.tedu.restaurant.service.exception.*;
import com.baomidou.mybatisplus.extension.service.IService;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author JachinLin
 * @since 2020-10-05
 */
public interface UserService extends IService<User> {
    void register(User user) throws InsertException, PhoneDuplicationException;
    User getByPhone(String phone)throws UserNotFoundException;
    User getByUid(Integer uid)throws UserNotFoundException;
    void changePassword(Integer uid, String oldPassword, String newPassword, String username)
        throws UserNotFoundException, PasswordNotMatchException, UpdateException;
    User login(String phone,String password)throws  UserNotFoundException, PasswordNotMatchException;
    void changeUserName(Integer uid,String username,String phone)
        throws UserNotFoundException, PasswordNotMatchException, UpdateException;
}
